import { Component } from '@angular/core';
import { Stacks } from '../../../../type';
import { StartsComponent } from '../../starts/starts.component';
import { Router } from '@angular/router';
import { StockService } from '../../../service/stock.service';



@Component({
  selector: 'app-stock-mange',
  imports: [StartsComponent],
  templateUrl: './stock-mange.component.html',
  styleUrl: './stock-mange.component.scss'
})
export class StockMangeComponent {

   stacks:Stacks[] = [];
  constructor(private router:Router, private stockService:StockService) { }
  ngOnInit() {
    console.log(2222)
    this.stacks =  this.stockService.getStacks()
  }
  create() {
    this.router.navigateByUrl('/stock/0')
  }
  edit(data:Stacks) {
    this.router.navigateByUrl(`/stock/${data.id}`)
  }

}
